/**
 * A structure that behaves like a queue but implements the Structure interface
 * Feel free to build on existing java implementations, no need to build from
 * scratch. (you can import and use something like LinkedList for example)
 * 
 * @param <T>
 */

import java.util.LinkedList;

public class StructureQueue<T> implements Structure<T> {

	private LinkedList<T> list;
	
	@Override
	public boolean isEmpty() {
		return list.isEmpty(); }

	@Override
	public void clear() {
		list.clear(); }

	@Override
	public void add(T node) {
		if (list==null) list = new LinkedList<T>();
		list.add(node); }

	@Override
	public T remove() {
		return list.removeFirst(); }
	
	@Override
	public int size() {
		return list.size();
	}
	
	@Override
	public boolean contains(T item){
		return list.contains(item);
	}

}
